/*
*	Developed by Leonardo Chatain and Pedro Dusso, at Universidade Federal do Rio Grande do Sul, Brasil, 2009/1
*	Source available at glpacman.codeplex.com
*/

#ifndef _CAMERA_H_
#define _CAMERA_H_

#include "Point3D.h"
#include "Vector3D.h"
#include <GL/glut.h>

class Camera
{
protected:
	Point3D position;
	Point3D lookAt;
	Vector3D up;

	float near;
	float far;
	
	static float aspectRatio;

public:
	Camera(void);
	Camera(Point3D position, Point3D lookAt);
	Camera(Point3D position, Point3D lookAt, float near, float far);
	Camera(Point3D position, Vector3D lookAt);
	Camera(Point3D position, Vector3D lookAt, float near, float far);
	Camera(float posX, float posY, float posZ, float lookAtX, float lookAtY, float lookAtZ);
	Camera(float posX, float posY, float posZ, float lookAtX, float lookAtY, float lookAtZ, float near, float far);
	~Camera(void);

	virtual void view();

	// Getters and setters
	inline Point3D getPosition() { return position; }
	inline Point3D getLookAt() { return lookAt; }
	inline void setPosition(Point3D pos) { position = pos; }
	inline void setPosition(float x, float y, float z) { position.setXYZ(x, y, z); }
	inline void setLookAt(Point3D look) { lookAt = look; }
	inline void setLookAt(float x, float y, float z) { lookAt.setXYZ(x, y, z); }
	inline void setLookAt(Vector3D vec) {
		lookAt.setX(position.getX() + vec.getX());
		lookAt.setY(position.getY() + vec.getY());
		lookAt.setZ(position.getZ() + vec.getZ());
	}
	inline void setUp(Vector3D Up){up = Up; }
	inline Vector3D getUp() { return up; }
	inline void setNear(float Near) { near = Near; }
	inline void setFar(float Far) { far = Far; }
	inline float getNear() { return near; }
	inline float getFar() { return far; }
	inline static void setAspectRatio(float aspect) { aspectRatio = aspect; }
	inline static float getAspectRatio() { return aspectRatio; }

};


#endif